package com.zhbg.controller;

import com.zhbg.pojo.Rights;
import com.zhbg.service.RightsService;
import com.zhbg.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/rights")
public class RightsController {
    @Autowired
    private RightsService rightsService;//右侧列表接口
    @GetMapping("/getRightsList")
    public SysResult getRightsList(){//获取右侧列表方法
        List<Rights> rightsList = rightsService.getRightsList();//返回右侧列表结合
        return SysResult.success(rightsList);
    }

    @GetMapping("/getRightsListAll")
    public SysResult getRightsListAll(){//获取右侧全部列表

        List<Rights> rightList = rightsService.getRightsListAll();

        return SysResult.success(rightList);
    }
}
